package com.thinkingstar.iads.cs.sys.controller;

import org.apache.jackrabbit.core.query.lucene.join.DescendantPathNodeJoin;
import org.apache.shiro.authz.annotation.Logical;
import org.apache.shiro.authz.annotation.RequiresPermissions;
import org.apache.shiro.authz.annotation.RequiresRoles;
import org.nutz.ioc.loader.annotation.IocBean;
import org.nutz.lang.util.NutMap;
import org.nutz.mvc.ViewModel;
import org.nutz.mvc.annotation.At;
import org.nutz.mvc.annotation.By;
import org.nutz.mvc.annotation.Filters;
import org.nutz.mvc.annotation.Ok;
import org.nutz.mvc.annotation.Param;

import com.thinkingstar.iads.common.filter.GlobalsFilter;
import com.thinkingstar.iads.common.filter.UserLoginFilter;

/**
 * 数据中心数据版本管理相关
 * @author Administrator
 *
 */
@IocBean
@At("/dataCenter")
@Filters({@By(type = GlobalsFilter.class), @By(type = UserLoginFilter.class)})
public class DataCenterModule {
	
	private static final String DcCenterPath = "beetl:/projectRoot/dcCenter/";
	
	/**
	 * 项目设计阶段module
	 * @return
	 */
    @At("/designPhase")
    @Ok(DcCenterPath+"projectInfo/projectDesignPhase.html")
	public NutMap projectDesignPhaseIndex(@Param("name") String name){
    	NutMap nutMap = new NutMap();
    	nutMap.put("name", name);
    	return nutMap;
	}
	
    /**
     * 项目设计内容module
     * @return
     */
    @At("/designContent")
    @Ok(DcCenterPath+"projectInfo/projectDesignContent.html")
    public NutMap projectDesignContentIndex(@Param("name") String name){
    	NutMap nutMap = new NutMap();
    	nutMap.put("name", name);
    	return nutMap;
    }
    
    
    /**
     * 项目设计专业module
     * @return
     */
    @At("/designMajor")
    @Ok(DcCenterPath+"projectInfo/projectDesignMajor.html")
    public NutMap projectDesignMajorIndex(@Param("name") String name){
    	NutMap nutMap = new NutMap();
    	nutMap.put("name", name);
    	return nutMap;
    }
    
    /**
     * 项目提入资料信息module
     * @param type
     * @return
     */
    @At("/mentionsInfo")
    @Ok(DcCenterPath+"projectInfo/projectMentionsInfo.html")
    public NutMap projectMentionsInfoIndex(@Param("name") String name){
    	NutMap nutMap = new NutMap();
    	nutMap.put("name", name);
    	return nutMap;
    }
    
    /**
     * 各设计内容互提资料维护
     * @return
     */
    @At("/mentionsByContent")
    @Ok(DcCenterPath+"projectInfo/projectMentionsByContent.html")
    public NutMap projectMentionsByContentIndex(@Param("name") String name){
    	NutMap nutMap = new NutMap();
    	nutMap.put("name", name);
    	return nutMap;
    }
    
    /**
     * 项目设备类型维护
     * @return
     */
    @At("/equipment/eqTypeTable")
    @Ok(DcCenterPath+"equipment/projectEquipmentType.html")
    public NutMap projectEquipmentTypeIndex(@Param("name") String name){
    	NutMap nutMap = new NutMap();
    	nutMap.put("name", name);
    	return nutMap;
    }
    
    //项目子设备类型维护
    @At("/equipment/eqcidTypeTable")
    @Ok(DcCenterPath+"equipment/projectEquipmentCidType.html")
    public NutMap projectChildrenEquipmentTypeIndex(@Param("name") String name){
    	NutMap nutMap = new NutMap();
    	nutMap.put("name", name);
    	return nutMap;
    }
    
    
    /**
     * 设备厂商维护
     * @return
     */
    @At("/equipment/eqManufactureTable")
    @Ok(DcCenterPath+"equipment/projectManufacturer.html")
    public NutMap projectManufacturerIndex(@Param("name") String name){
    	NutMap nutMap = new NutMap();
    	nutMap.put("name", name);
    	return nutMap;
    }
    
    /**
     * 设备维护
     * @param type
     * @return
     */
    @At("/equipment/eqTable")
    @Ok(DcCenterPath+"equipment/projectEquipment.html")
    public NutMap projectEquipmentIndex(@Param("name") String name){
    	NutMap nutMap = new NutMap();
    	nutMap.put("name", name);
    	return nutMap;
    }
    
    //设备配备维护
    @At("/equipment/equip")
    @Ok(DcCenterPath+"equipment/projectEquipmentEquip.html")
    public NutMap projectEquipmentEquip(@Param("name") String name){
    	NutMap nutMap = new NutMap();
    	nutMap.put("name", name);
    	return nutMap;
    }
    
    
    /**
     * 厂商设备维护
     * @param type
     * @return
     */
    @At("/equipment/manufacturerEqTable")
    @Ok(DcCenterPath+"equipment/projectManufacturerEquipment.html")
    public NutMap projectManufacturerEquipmentIndex(@Param("name") String name){
    	NutMap nutMap = new NutMap();
    	nutMap.put("name", name);
    	return nutMap;
    }
    
    
    /**
     * 设备概算表维护
     */
    @At("/equipment/budget")
    @Ok(DcCenterPath+"equipment/equipmentBudget.html")
    public NutMap equipmentBudgetIndex(@Param("name") String name){
    	return new NutMap("name",name);
    }
    
    
    /**
     * 设备属性维护
     * @return
     */
    @At("/equipment/equipmentAttribute")
    @Ok(DcCenterPath+"equipment/equipmentAttribute.html")
    public NutMap equipmentAttributeIndex(@Param("equipment_id") String equipment_id){
    	NutMap nutMap = new NutMap();
    	nutMap.setv("equipment_id", equipment_id);
    	return nutMap;
    }
    
	/**
	 * 获取结构化表单对象
	 * @return
	 */
/*	@RequiresRoles(value = {"admin","系统管理","设计人员"},logical=Logical.OR)
	@RequiresPermissions(value = {"编辑:projEdit","查看:projView"},logical=Logical.OR)*/
	@At("/findFromFieldHtml/?")
	@Ok("beetl:/include/dcenter/fromTable.html")
	public NutMap findFromFieldHtml(String table_name){
		NutMap nutMap = new NutMap();
		nutMap.setv("table_name", table_name);
		return nutMap;
	}
	
	//富文本编辑框
	@At("/richTextCommon/?")
	@Ok("beetl:/include/dcenter/richText.html")
	public NutMap richTextCommon(String equipment_id){
    	NutMap nutMap = new NutMap();
    	nutMap.setv("equipment_id", equipment_id);
		return nutMap;
	}
	
	
	/**
	 * 获取非结构化表单对象
	 * @return
	 */
	@At("/findNoFromFieldHtml/?")
	@Ok("beetl:/include/dcenter/noFromTable.html")
	public NutMap findNoFromFieldHtml(String table_name){
		NutMap nutMap = new NutMap();
		nutMap.setv("table_name", table_name);
		return nutMap;
	}
	
	
	//常量版本库维护
	@At("/constantLibrary")
	@Ok("beetl:/projectRoot/dcCenter/constant/projectDesignConstant.html")
	public NutMap constantLibrary(@Param("name") String name){
    	NutMap nutMap = new NutMap();
    	nutMap.put("name", name);
    	return nutMap;
	}
	
	//公式库版本维护
	@At("/formulaLibrary")
	@Ok("beetl:/projectRoot/dcCenter/formula/projectDesignFormula.html")
	public NutMap formulaLibrary(@Param("name") String name){
    	NutMap nutMap = new NutMap();
    	nutMap.put("name", name);
    	return nutMap;
	}
	
	//设计单元维护
	@At("/variableLibrary")
	@Ok("beetl:/projectRoot/dcCenter/variable/projectDesignCell.html")
	public NutMap variableLibrary(@Param("name") String name){
    	NutMap nutMap = new NutMap();
    	nutMap.put("name", name);
    	return nutMap;
	}
	
	//模板库维护
	@At("/templateLibrary")
	@Ok("beetl:/projectRoot/dcCenter/templeate/projectDesignTemplate.html")
	public NutMap templateLibrary(@Param("name") String name){
    	NutMap nutMap = new NutMap();
    	nutMap.put("name", name);
    	return nutMap;
	}
	
	//合成所需的模板库维护
	@At("/designTemplateLibrary")
	@Ok("beetl:/projectRoot/dcCenter/templeate/projectTemplate.html")
	public NutMap designTemplateLibrary(@Param("name") String name){
    	NutMap nutMap = new NutMap();
    	nutMap.put("name", name);
    	return nutMap;
	}
	
	//提出资料维护
	@At("/putForwardInfo")
	@Ok("beetl:/projectRoot/dcCenter/forword/projectForword.html")
	public NutMap putForwardInfo(@Param("name") String name){
    	NutMap nutMap = new NutMap();
    	nutMap.put("name", name);
    	return nutMap;
	}
	
	//工艺设备库
	@At("/gyEquipment")
	@Ok("beetl:/projectRoot/dcCenter/historyDataBase/gyEquipment.html")
	public NutMap historyDataBase(@Param("name") String name){
		return new NutMap("name",name);
	}
	
	//救援设备库
	@At("/rescueFacility")
	@Ok("beetl:/projectRoot/dcCenter/historyDataBase/rescueFacility.html")
	public NutMap rescueFacility(@Param("name") String name){
		return new NutMap("name",name);
	}
	

	//动车设施库
	@At("/bulletFacility")
	@Ok("beetl:/projectRoot/dcCenter/historyDataBase/bulletFacility.html")
	public NutMap bulletFacility(@Param("name") String name){
		return new NutMap("name",name);
	}
	
	//多文件上传
	@At("/uploadFiles")
	@Ok("beetl:/include/webUploader.html")
	public void uploadFiles(){
	}
	
	//机务设施数据库
	@At("/jwsssjk")
	@Ok("beetl:/projectRoot/dcCenter/jwsssjk/jwsssjk.html")
	public void jwsssjk(){
	}
	
	//站站里程数据库
	@At("/zzmileageLibrary")
	@Ok("beetl:/projectRoot/dcCenter/zzMileageLibrary/zzMileageLibrary.html")
	public void zzmileageLibrary(){
	}
	

}
